package com.gaofeng.day11;

/**
 * @author gaofeng
 * @date 2024-12-22 - 21:52
 */
public class demo11 {
    public static void main(String[] args) {
        int[] arr = {1,2,100,4,5};
        int number = max(arr);
        System.out.println(number);
    }

    public static int max(int[] arr) {
        int max = arr[0];
        for (int i = 1; i < arr.length; i++) {
             if (arr[i] > max){
                max = arr[i];
             }
        }
        return max;
    }
}
